<?php

/** 
 * 实例控制器
 * @author Lucky 
 */
class ExampleController extends BaseController
{
	public function example1()
	{
		header('content="text/html;charset=utf-8');
		//ini_set('display_error', 1);
		//$uId = intval( $_GET['uId'] );
		error_reporting( E_ALL ^ E_NOTICE );
		ini_set('display_errors', 'on');
		$model = MyModel::getInstance( 1 , true );
		$model->setRegisterTime( date( 'Y-m-d H:i:s' ) );
//		print_r( $model->getData() );
		ObjectStorage::save();
		//$data = $model->find('user');
//		var_export($data);
		echo "直接输出";
	}
	
	public function example2()
	{
		$model = MyModel::getInstance(1, true);
		$model->delete();
		ObjectStorage::save();
		$name = "zhanghao";
		include( TPL_DIR .'/TestTemplate/tpl1.php' );
	}
	
	public function example3()
	{
		echo json_encode( array( 'message' => '直接JSON输出' ) );
	}
	
	public function example4()
	{
		return array( 'message' => '返回JSON输出' );
	}
}
?>